package com.xy.biz.base.domain.converter;

import com.xy.biz.base.domain.bo.BizCodeBO;
import com.xy.biz.base.domain.dto.BizCodeDTO;
import com.xy.biz.base.domain.po.BizCodePO;
import com.xy.tool.util.BeanUtilsEx;

import java.util.Collection;
import java.util.List;

/**
 * 
 * 
 * @author zsp
 * @date 2020-8-25
 */
public class BizCodeConverter {
	
	public static BizCodePO toPO(BizCodeBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new BizCodePO(), true);
	}
	
	public static List<BizCodePO> toPO(Collection<BizCodeBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new BizCodePO(), true);
	}
	
	public static BizCodeBO fromPO(BizCodePO source) {
		return BeanUtilsEx.copyProperties(source, () -> new BizCodeBO());
	}
	
	public static List<BizCodeBO> fromPO(Collection<BizCodePO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new BizCodeBO());
	}
	
	public static BizCodeDTO toDTO(BizCodeBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new BizCodeDTO());
	}
	
	public static List<BizCodeDTO> toDTO(Collection<BizCodeBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new BizCodeDTO());
	}

}
